//
//  SXTRegisterViewController.m
//  SYT
//
//  Created by 彭之耀 on 2017/9/1.
//  Copyright © 2017年 个人学习. All rights reserved.
//

#import "SXTRegisterViewController.h"
#import "SXTRegisterView.h"                  //注册
#import "SXTThirdLogInView.h"                //第三方登录View
#import "SXTRegisterNextViewController.h"    //下一页

@interface SXTRegisterViewController ()

@property (strong,nonatomic) SXTRegisterView *registerView;        //注册
@property (strong,nonatomic) SXTThirdLogInView *thirdLoginView;    //第三方登录

@end

@implementation SXTRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = MainColor;
    self.edgesForExtendedLayout = 0;
    [self.view addSubview:self.registerView];
    [self.view addSubview:self.thirdLoginView];
    self.title = @"注册";
    __weak typeof (self) weakSelf = self;
    [_registerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(weakSelf.view);
        make.height.mas_equalTo(@230);
    }];
    [_thirdLoginView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(weakSelf.view);
        make.top.equalTo(weakSelf.registerView.mas_bottom);
        make.height.mas_equalTo(@85);
    }];
    
}

-(SXTRegisterView *)registerView{
    if (!_registerView) {
        _registerView = [[SXTRegisterView alloc]init];
        __weak typeof (self) weakSelf = self;
        _registerView.pushNextBlock = ^(NSDictionary *dic){
            SXTRegisterNextViewController *nextViewController = [[SXTRegisterNextViewController alloc]init];
            [weakSelf.navigationController pushViewController:nextViewController animated:YES];
            nextViewController.userMessage = dic;
        };
    }
    return _registerView;
}

-(SXTThirdLogInView *)thirdLoginView{
    if (!_thirdLoginView) {
        _thirdLoginView = [[SXTThirdLogInView alloc]init];
    }
    return _thirdLoginView;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
